﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ChoViet.CMS.ViewModels.AdAttributeIndexViewModel>" %>
<%@ Import Namespace="ChoViet.Lib.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Thuộc tính cho chuyên mục
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Header" runat="server">
	Thuộc tính cho chuyên mục
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Message" runat="server">
    <%=ViewData["MessageInfo"]!=null? "<p class='perror'>"+Html.Encode(ViewData["MessageInfo"])+"</p>":string.Empty%> 
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Toolbar" runat="server">
	<%= Html.Toolbar("Thêm mới", "/AdAttribute/CreateCms/"  , "new") %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%if(ViewData["MessageInfo"]==null){ %>
	<form action="/AdAttribute/IndexCms" method="post" name="adminForm">
	<table width="100%">
        <tr>
            <td align="left">
                Tìm nhanh
                <%= Html.TextBoxFor(model => model.Keyword, Model.Keyword) %>
                <%= Html.ActionImageJS("Tìm kiếm", "icon-32-search.png", "document.adminForm.submit();", false)%>
            </td>
            <td align="right">
                <%=Html.DropDownListFor(model => model.CurrentCat, new SelectList(Model.CategoryBuiltTree, "Value", "Text", Model.CurrentCat).ToList(), "-- Chọn chuyên mục --", new { onchange = "document.adminForm.submit();" })%>
            </td>
        </tr>
    </table>
		<table width="100%" class="adminlist">
			<tr>
				<th width="10" align="right">STT</th>
				<th width="30"></th>
				<th width="30"></th>
				<th>
					<%= Html.Sort("Tên thuộc tính", "Name", ViewData["orderDir"].ToString(), ViewData["order"].ToString())%>
				</th>
				<th>
					Mô tả
				</th>					
				<th width="30">
					<%= Html.Sort("ID", "ID", ViewData["orderDir"].ToString(), ViewData["order"].ToString())%>
				</th>
			</tr>
		<% 
			int i = 0;
    		foreach (var item in Model.AdAttributes) {
		%>		
			<tr>
				<td align="center">
					<%= i.ToString() %>
				</td>
				<td align="center">
					<%= Html.ActionImage("Sửa", "icon-24-edit.png", "AdAttribute", "EditCms", new Dictionary<string, object>() { { "id", item.ID } })%>
				</td>
				 <td align="center">
					<%= Html.ActionImage("Xóa", "icon-24-delete.png", "AdAttribute", "DeleteCms", new Dictionary<string, object>() { { "id", item.ID } })%>
				</td>
				<td>
					<%= Html.ActionLink(item.Name, "DetailsCms", new { id = item.ID })%>
				</td>
				<td><%=item.Description %></td>
				<td align="center">
					<%= Html.Encode(item.ID)%>
				</td>
			</tr>
		<% i++;
            } %>

		</table>
		<%= Html.Hidden("order")%>
		<%= Html.Hidden("orderDir")%>
	</form>
<% } %>

</asp:Content>
